<template>
  <div>
    <tb-report
      :columns="columns"
      :apiUrl="apiUrl"
      :getData="getData"
      :tableData="tableData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmDomesticInspectionTraceability/list",
      columns: [
        {
          title: "序号",
          fixed: 'left', 
          type: "seq",
          width: 60,
          align: "center",
        },
        { key: 'marksNo', title: '唛头号', field: 'marksNo', width: 200 },
    {
      key: 'inspectAuditDate',
      title: '包装检验完成日期',
      field: 'inspectAuditDate',
      width: 180,
    },
    {
      key: 'logisticsConfirmDate',
      title: '物流审核完成日期',
      field: 'logisticsConfirmDate',
      width: 180,
    },
    {
      key: 'deliveryDate',
      title: '发货日期',
      field: 'deliveryDate',
      width: 180,
    },
    {
      key: 'warehousedDate',
      title: '码头入库日期',
      field: 'warehousedDate',
      width: 180,
    },
    { key: 'shelfNo', title: '箱架号', field: 'shelfNo', width: 200 },
    {
      key: 'packingDate',
      title: '装箱日期',
      field: 'packingDate',
      width: 180,
    },
    {
      key: 'shipmentDate',
      title: '装船日期',
      field: 'shipmentDate',
      width: 180,
    }
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
